package user;

import item.ShoppingCartItem;

import java.util.ArrayList;
import java.util.List;

/**
 * Customer class represents a customer who is currently logged into the system
 * @author Stuart Rowe
 *
 */
public class Customer {
	private String cid;
	private String password;
	private String name;
	private String address;
	private String phone;
	
	private List<ShoppingCartItem> shoppingCart;
	
	public Customer(String cid, String password, String name, String address, String phone)
	{
		this.cid = cid;
		this.password = password;
		this.name = name;
		this.address = address;
		this.phone = phone;
		
		shoppingCart = new ArrayList<ShoppingCartItem>();
	}

	public String getCid() {
		return cid;
	}

	public String getPassword() {
		return password;
	}

	public String getName() {
		return name;
	}

	public String getAddress() {
		return address;
	}

	public String getPhone() {
		return phone;
	}	
	
	public void addItemToCart(ShoppingCartItem cartItem)
	{
		shoppingCart.add(cartItem);
	}
	
	public boolean removeItemFromCart(ShoppingCartItem cartItem)
	{
		return shoppingCart.remove(cartItem);
	}
	
	public List<ShoppingCartItem> getShoppingCart()
	{
		return this.shoppingCart;
	}
	
}
